$(document).ready(function () {
    console.log("is here");
    $("#comsume").hide();
    $("#recharge").hide();
    $("#withdraw").hide();
    $("#accountset").hide();
    $("#incomebtn").click(function(){
        income();
    });
    $("#comsumebtn").click(function () {
        comsume();
    });
    $("#rechargebtn").click(function () {
        recharge();
    });
    $("#withdrawbtn").click(function () {
        withdraw();
    });
    $("#accountsetbtn").click(function () {
        accountset();
    });

});
function income() {
    console.log("click income");
    $("a[name='menu']").each(function(){
        console(this.html());
    })
    $("#income").show();
    $("#comsume").hide();
    $("#recharge").hide();
    $("#withdraw").hide();
    $("#accountset").hide();
}
function comsume() {
    console.log("click consumer");
    $("#income").hide();
    $("#comsume").show();
    $("#recharge").hide();
    $("#withdraw").hide();
    $("#accountset").hide();
}
function recharge() {
    console.log("click recharge");
    $("#income").hide();
    $("#comsume").hide();
    $("#recharge").show();
    $("#withdraw").hide();
    $("#accountset").hide();
}
function withdraw() {
    console.log("click withdraw");
    $("#income").hide();
    $("#comsume").hide();
    $("#recharge").hide();
    $("#withdraw").show();
    $("#accountset").hide();
}
function accountset() {
    console.log("click accountset");
    $("#income").hide();
    $("#comsume").hide();
    $("#recharge").hide();
    $("#withdraw").hide();
    $("#accountset").show();
}

var $table = $('#incometab');
$table.bootstrapTable({
    url: "duoBaoActivityList",
    dataType: "json",
    pagination: true, //分页
    singleSelect: false,
    search:true, //显示搜索框
    sidePagination:"server", //服务端处理分页
    columns:[
        {
            title: '活动名称',
            field: 'name',
            align: 'center',
            valign: 'middle'
        },
        {
            title: '状态',
            field: 'status',
            align: 'center',
            valign: 'middle',
        },
        {
            title: '参与人数',
            field: 'participationCounts',
            align: 'center'
        },
        {
            title: '总人数',
            field: 'totalCounts',
            align: 'center'
        },
        {
            title: '开始时间',
            field: 'startTime',
            align: 'center',
        },
        {
            title: '操作',
            field: 'id',
            align: 'center',
            formatter:function(value,row,index){
                var e = '<a href="#" mce_href="#" onclick="edit(\''+ row.id + '\')">编辑</a> ';
                var d = '<a href="#" mce_href="#" onclick="del(\''+ row.id +'\')">删除</a> ';
                return e+d;
            }
        }
    ]
});

